<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<title>城市下拉选择组件</title>
	<link rel="stylesheet" type="text/css" href="./cityPicker.css">
</head>

<body>
	<!-- <div class="container">

		<h3>模拟城市-自动选择第一项/无搜索/三级城市</h3>
		<div class="dome-main">
			<div class="city-picker-selector" id="city-picker-selector2"></div>
		</div>
	</div> -->
	<div id="citypicker">loading...</div>
	<!--<script src="https://cdn.bootcss.com/jquery/1.10.0/jquery.js"></script>-->
	<!-- <script type="text/javascript" src="./citydata.min.js"></script> -->
	<script type="text/javascript" src="./cityPicker.js"></script>
	<!-- <script type="text/javascript" src="./cityPicker-2.0.2.js"></script> -->
	<script type="text/javascript">
		$(function () {
			// // 显示代码
			// $('.show-code').on('click', function (event) {
			// 	var $this = $(this);

			// 	$this.next('pre').slideToggle(500);
			// });
			// var selector2 = $('#city-picker-selector2').cityPicker({
			// 	dataJson: cityData,
			// 	renderMode: true,
			// 	search: false,
			// 	autoSelected: true,
			// 	code: 'cityCode',
			// 	level: 3,
			// 	onChoiceEnd: function() {
			// 		console.log(this.values)
			// 	}
			// });

			// // 设置城市
			// selector2.setCityVal('广东省, 广州市, 天河区');
			$.ajax( {
				url: "/location",
				type: "get",
				dataType: "json",
				success: function( data ){
                    new CityPicker({
                        target: "#citypicker",
                        data: data 
                    })
				}
			} )
		});
	</script>
</body>

</html>